<template>
	<div class="about">
		{{n}}---{{arrA}}
		
		<!-- {{this.$store.getters.doarr}} -->
		
		<!-- <button @click="addN(10)">每隔1000毫秒，修改n</button> -->
		
		<button @click="asyncChangeN(50)">每隔1000毫秒，修改n</button>
	</div>
</template>

<script>
	import {mapActions,mapGetters} from "vuex"
	
	export default{
		name:"About",
		data(){
			return{	
			}
		},
		methods:{
			...mapActions(["asyncChangeN"])
			// ...mapActions({
			// 	addN:"asyncChangeN"
			// })
			// addN(){//要想调用Action,必须通过dispatch
			//    //第二个参数，是payload 参数，多个的时候对象
			// 	this.$store.dispatch("asyncChangeN",100);
			// }
		},
		computed:{
			n(){
				return this.$store.state.n
			},
			// doarr(){
			// 	return this.$store.getters.doarr
			// }
			//...mapGetters(["doarr"])
			
			...mapGetters({
				arrA:"doarr"
			})
		}
	}
</script>

<style>
</style>
